#pragma once
#include "IMenuState.h"
#include "../source/Player.h"
#include "../source/Dodgeball.h"


class EntityManager;
class CWall;

class CDodgeBomb :
	public CIMenuState
{
	CDodgeBomb() = default;
	~CDodgeBomb() = default;

	CDodgeBomb(const CDodgeBomb&) = delete;
	CDodgeBomb& operator= (const CDodgeBomb&) = delete;

	CPlayer* m_pPlayer1 = nullptr;
	CPlayer* m_pPlayer2 = nullptr;
	CPlayer* m_pPlayer3 = nullptr;
	CPlayer* m_pPlayer4 = nullptr;
	EntityManager*	m_pEntities = nullptr;

	CWall* m_TopWall;
	CWall* m_BotWall;
	CWall* m_LeftWall;
	CWall* m_RightWall;
	CDodgeball* testBall;

	CParticleManager* pParticleSys;

	float m_uGameTime = 120.0f;
	int m_nRedScore = 0;
	int m_nBlueScore = 0;
	float m_fWinTimer = 5;
	bool m_bWon = false;
	int m_nDead = 0;

	

	SGD::HTexture boom;
	bool flash = true;
	bool m_bMainGame = false;
	float time = 0;

	std::vector<SGD::Point> ballSpawns;

public:
	static  CDodgeBomb* GetInstance(void);

	virtual void Enter(void);
	virtual void Exit(void);

	virtual bool Input(void);
	virtual void Update(float elapsedTime);
	virtual void Render(void);
	void SetDeadCount(int i){ m_nDead = i; }
	int GetDeadCount(){ return m_nDead; }

	void PassPlayers(CPlayer* p, int playernumber);
	Entity* CreateBall(SGD::Point position, SGD::Size size);
	void PassData(int redscore, int bluescore);
	Entity* CreatePunch(Entity* pOwner) const;
	void DeleteEntity(Entity* e);
};

